package com.yilin.tms.core.commons.base;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.yilin.tms.core.commons.annotation.Explain;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import javax.persistence.Version;

@MappedSuperclass
public class BaseDataEntity extends BaseEntity{

    /**
     * 平台信息
     */
    @Transient
    @TableField(exist = false)
    private String platId;
    @Transient
    @TableField(exist = false)
    private String platName;
    @Explain("上级平台")
    @Column(name = "superior_plat_id")
    private String superiorPlatId;
    @Explain("上级平台")
    private String superiorPlatName;

    @Explain("逻辑删除")
    @TableLogic
    @Column(name = "is_deleted", columnDefinition = "INT default 0")
    private Integer isDeleted;
    @Explain("乐观锁")
    @Version()
    @Column(name = "version", columnDefinition = "INT default 0")
    private Integer version = 0;

    public String getPlatId() {
        return platId;
    }

    public void setPlatId(String platId) {
        this.platId = platId;
    }

    public String getPlatName() {
        return platName;
    }

    public void setPlatName(String platName) {
        this.platName = platName;
    }

    public String getSuperiorPlatId() {
        return superiorPlatId;
    }

    public void setSuperiorPlatId(String superiorPlatId) {
        this.superiorPlatId = superiorPlatId;
    }

    public String getSuperiorPlatName() {
        return superiorPlatName;
    }

    public void setSuperiorPlatName(String superiorPlatName) {
        this.superiorPlatName = superiorPlatName;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
